package com.ims.core.doc.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ims.common.annotation.Log;
import com.ims.common.core.controller.BaseController;
import com.ims.common.core.domain.AjaxResult;
import com.ims.common.enums.BusinessType;
import com.ims.core.doc.domain.TInNon1016;
import com.ims.core.doc.service.ITInNon1016Service;
import com.ims.common.utils.poi.ExcelUtil;
import com.ims.common.core.page.TableDataInfo;

/**
 * 1016 航空运输电子客票行程单退改费  Controller
 *
 * @author IMS
 * @date 2024-12-01
 */
@RestController
@RequestMapping("/doc/hangkongdianzikepiao")
public class TInNon1016Controller extends BaseController
{
    @Autowired
    private ITInNon1016Service tInNon1016Service;

    /**
     * 查询1016 航空运输电子客票行程单退改费  列表
     */
    @PreAuthorize("@ss.hasPermi('doc:hangkongdianzikepiao:list')")
    @GetMapping("/list")
    public TableDataInfo list(TInNon1016 tInNon1016)
    {
        startPage();
        List<TInNon1016> list = tInNon1016Service.selectTInNon1016List(tInNon1016);
        return getDataTable(list);
    }

    /**
     * 导出1016 航空运输电子客票行程单退改费  列表
     */
    @PreAuthorize("@ss.hasPermi('doc:hangkongdianzikepiao:export')")
    @Log(title = "1016 航空运输电子客票行程单退改费  ", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TInNon1016 tInNon1016)
    {
        List<TInNon1016> list = tInNon1016Service.selectTInNon1016List(tInNon1016);
        ExcelUtil<TInNon1016> util = new ExcelUtil<TInNon1016>(TInNon1016.class);
        util.exportExcel(response, list, "1016 航空运输电子客票行程单退改费  数据");
    }

    /**
     * 获取1016 航空运输电子客票行程单退改费  详细信息
     */
    @PreAuthorize("@ss.hasPermi('doc:hangkongdianzikepiao:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(tInNon1016Service.selectTInNon1016ById(id));
    }

    /**
     * 新增1016 航空运输电子客票行程单退改费  
     */
    @PreAuthorize("@ss.hasPermi('doc:hangkongdianzikepiao:add')")
    @Log(title = "1016 航空运输电子客票行程单退改费  ", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TInNon1016 tInNon1016)
    {
        return toAjax(tInNon1016Service.insertTInNon1016(tInNon1016));
    }

    /**
     * 修改1016 航空运输电子客票行程单退改费  
     */
    @PreAuthorize("@ss.hasPermi('doc:hangkongdianzikepiao:edit')")
    @Log(title = "1016 航空运输电子客票行程单退改费  ", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TInNon1016 tInNon1016)
    {
        return toAjax(tInNon1016Service.updateTInNon1016(tInNon1016));
    }

    /**
     * 删除1016 航空运输电子客票行程单退改费  
     */
    @PreAuthorize("@ss.hasPermi('doc:hangkongdianzikepiao:remove')")
    @Log(title = "1016 航空运输电子客票行程单退改费  ", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tInNon1016Service.deleteTInNon1016ByIds(ids));
    }
}
